import { ChatItem } from "../chatPanel/ChatItem";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { DateParser } from "../../../../common/tools/DateParser";
//class ChatTimeItem
    
    export  class ChatTimeItem /* flash.display.Sprite */
    {
        constructor(arg1: ChatItem, arg2: string, arg3: Date, arg4: string="")
        {
            
            this._chatItem = arg1;
            this.init(arg1, arg2, arg3, arg4);
            return;
        }

        /* internal  */init(arg1: ChatItem, arg2: string, arg3: Date, arg4: string): void
        {
            arg3 = arg3 ? arg3 : new Date();
            var loc1;
            (loc1 = new Object /* flash.text.TextField */()).width = 300;
            loc1.height = 22;
            loc1.selectable = false;
            loc1.filters = [FilterConst.glowFilter];
            loc1.defaultTextFormat = new GTextFormat(FontUtil.songtiName);
            loc1.htmlText = HTMLUtil.addColor(arg2, GlobalStyle.color4) + "&nbsp;&nbsp;" + HTMLUtil.addColor(DateParser.parse(arg3, "【hh: mm: ss】"), GlobalStyle.color5);
            loc1.y = 0;
            loc1.x = 2;
            this.addChild(loc1);
            arg1.y = 19;
            arg1.x = 24;
            this.addChild(arg1);
            return;
        }

        public /* override */ get height(): number
        {
            return 19 + this._chatItem.height;
        }

        public dispose(): void
        {
            this._chatItem.dispose();
            return;
        }

        /* internal */ /* var */_textFieldTime: Object /* flash.text.TextField */;

        /* internal */ /* var */_chatItem: ChatItem;
    }
